/*******************************************************************************
* CSCI321 Major Project 2010 - University of Wollongong                        *
********************************************************************************
* Program:		WeaveEdit                                              *
* Authors:		Simon Allen (Student#: 3457527, Unix: sa655)           *
*			Scott Bellis (Student#: 3479110, Unix: sjb900)         *
*			Jason Benger (Student#: 3454137, Unix: jb960)          *
*			Timothy Newmarch (Student#: 3459263 Unix: tgn336)      *
*			Benjamin Richardson (Student# 3467752, Unix: bjr401)   *
* Supervisor:		Daniel F. Saffioti                                     *
* Modified:		28/10/2010                                             *
* Description:		WeaveEdit is a highly portable collaborative text      *
*			editor and word processor, allowing several users to   *
*			read and edit multiple documents at the same time.     *
*			It is available for Mac OS X, Windows and Linux,       *
*			utilising Nokia's Qt development framework.            *
*******************************************************************************/


#ifndef USERHIGHLIGHTER_H
#define USERHIGHLIGHTER_H

#include <srchiliteqt/Qt4SyntaxHighlighter.h>
#include "Networking/usermanager.h"

class UserHighlighter : public srchiliteqt::Qt4SyntaxHighlighter
{
	Q_OBJECT

public:
	UserHighlighter(QTextDocument *newParent, UserManager *newUserManager);

public slots:
	void toggleHighlighting(const bool mode);
	void toggleSyntaxHighlighting(const bool mode);
	void rehighlight();

protected:
	void highlightBlock(const QString &text);

private:
	bool highlighted;
	bool syntaxHighlighted;
	UserManager *userManager;
	QTextDocument *parent;
};

#endif // USERHIGHLIGHTER_H
